package nmrworkflow.framework.configuration;

import java.io.File;

public class Preferences
{
	
	private File nmrPipePath = new File("/usr/local/bin/nmrPipe/nmrbin.linux9/nmrPipe");
	private File showHdrPath = new File("/usr/local/bin/nmrPipe/nmrbin.linux9/showhdr");
	private File tempPath = new File("/tmp/");
	
	private static Preferences instance = null;
	
	public static Preferences getInstance()
	{
		if(instance ==  null)
			instance = new Preferences();
		
		return instance;
	}

	public File getNmrPipePath()
	{
		return nmrPipePath;
	}

	public boolean setNmrPipePath(File nmrPipePath)
	{
		if(nmrPipePath.exists() && nmrPipePath.isFile() && nmrPipePath.canExecute())
		{
			this.nmrPipePath = nmrPipePath;
			return true;
		}
		
		return false;
	}

	public File getShowHdrPath()
	{
		return showHdrPath;
	}

	public boolean setShowHdrPath(File showHdrPath)
	{
		if( showHdrPath.exists() && showHdrPath.isFile() && showHdrPath.canExecute())
		{
			this.showHdrPath = showHdrPath;
			return true;
		}
		
		return false;
	}

	public File getTempPath()
	{
		return tempPath;
	}

	public boolean setTempPath(File tempPath)
	{
		if( tempPath.exists() && tempPath.isDirectory() && tempPath.canWrite())
		{
			this.tempPath = tempPath;
			return true;
		}
		
		return false;
	}
	
	

	
}
